package com.prs.crm.domain.document;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.prs.crm.domain.BaseEntity;

@Entity
@Table(name="docu_numberset")
public class NumberSet extends BaseEntity{

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;

	private String codeEdit;  //编号样式编辑
	private String edit;    //有逗号的样式
	
	private String codeSample; //编号样式显示例
	private String sample;  //有逗号的示列
	
	private String AddMode;  //累加方式
	private String codeNum;  //编号位数
	private String nowCode;  //当前编号
	private String state;
	
	@OneToMany(cascade={CascadeType.ALL})
	private Set<DraftType> draftType;
	
	public void addDraftType(DraftType dt){
		if (draftType==null) {
			draftType=new HashSet<DraftType>();
		}
		dt.setNumberSet(this);
		draftType.add(dt);
	}
	public Set<DraftType> getDraftType() {
		return draftType;
	}
	public void setDraftType(Set<DraftType> draftType) {
		this.draftType = draftType;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}

	public String getCodeEdit() {
		return codeEdit;
	}
	public void setCodeEdit(String codeEdit) {
		this.codeEdit = codeEdit;
	}
	public String getEdit() {
		return edit;
	}
	public void setEdit(String edit) {
		this.edit = edit;
	}
	public String getCodeSample() {
		return codeSample;
	}
	public void setCodeSample(String codeSample) {
		this.codeSample = codeSample;
	}
	public String getSample() {
		return sample;
	}
	public void setSample(String sample) {
		this.sample = sample;
	}
	public String getAddMode() {
		return AddMode;
	}
	public void setAddMode(String addMode) {
		AddMode = addMode;
	}
	public String getCodeNum() {
		return codeNum;
	}
	public void setCodeNum(String codeNum) {
		this.codeNum = codeNum;
	}
	public String getNowCode() {
		return nowCode;
	}
	public void setNowCode(String nowCode) {
		this.nowCode = nowCode;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
}
